<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    </head>
    <body>
        <div id="app">
            <button data-title="yahoo">button</button>
        </div>

        <script type="module">
            import util from './util.js'
            const app = document.getElementById('app')
            app.querySelector('button').addEventListener('click', function () {
                alert(this.dataset.title)
            })
            const a = util.createElement('a', {
                href: '#',
                textContent: 'link',
            })
            app.insertAdjacentElement('beforebegin', a)
            // app.appendChild(a)
            // app.innerHTML += "<a href='#'>link</a>"
        </script>
    </body>
</html>
